package com.chengda.dashboard.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chengda.dashboard.entity.MachineInfo;
import com.chengda.dashboard.mapper.MachineInfoMapper;
import com.chengda.dashboard.service.MachineInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 机台信息服务实现类
 */
@Service
public class MachineInfoServiceImpl extends ServiceImpl<MachineInfoMapper, MachineInfo> implements MachineInfoService {

    @Override
    public List<MachineInfo> getMachineInfoByWorkshopType(String workshopType) {
        return baseMapper.selectByWorkshopType(workshopType);
    }

    @Override
    public List<MachineInfo> getCustomMachineInfo(String workshopType) {
        return baseMapper.selectCustomMachines(workshopType);
    }

    @Override
    public boolean saveOrUpdateMachineInfo(MachineInfo machineInfo) {
        return saveOrUpdate(machineInfo);
    }

    @Override
    public boolean deleteMachineInfo(Long id) {
        return removeById(id);
    }
}
